#!/bash/sh

DEPLOY_DIR=/xdfapp
JAR_FILE=study-alibaba-arthas-1.0.jar
GC_LOG_FILE=/xdfapp/gc.log

#启动参数
JAVA_MEM_OPTS=" -Xms300m -Xmx300m -Xmn64m -Xss256k"
JAVA_GC_OPTS1=" -XX:NewRatio=1 -XX:NewSize=100m -XX:MaxNewSize=100M"
JAVA_GC_OPTS2=" -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -verbose:gc -Xloggc:"$GC_LOG_FILE
JAVA_OPTS=$JAVA_MEM_OPTS$JAVA_GC_OPTS1$JAVA_GC_OPTS2

/usr/bin/sudo pkill -f $JAR_FILE
sleep 1
source /etc/profile
nohup java $JAVA_OPTS -jar $DEPLOY_DIR/$JAR_FILE 2>&1 &
exit 0
